<h1>列表</h1>
<div>
    <input #bookName placeholder="请输入书名"/>
    <input #authorName placeholder="请输入作者"/>
    <button (click)='addBook(bookName,authorName)'>加入书架</button>
</div>
<ul>
    <li *ngFor='let book of books' class="flex space-around">
        <div class="flex space-around">
            <h2>{{book.name}}</h2> 
            <span style="padding: 28px 0 0 8px;" >
                {{book.author || '佚名'}} 著
            </span>
        </div>

        <div>
            <button (click)='delBook(book.id)' style="margin: 1.5rem 0;">删除</button>
        </div>
    </li>
</ul>